﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CNotebook
{
    public class TeritorryManager:ConnectionManager
    {
        public DataTable GetTeritorry()
        {
            try
            {
                SqlCommand oCommand = new SqlCommand();
                SqlDataAdapter oAdapter = new SqlDataAdapter();
                DataSet ds = new DataSet();

                oCommand.Connection = this.Connection;
                oCommand.CommandType = CommandType.Text;
                oCommand.CommandText = "SELECT * FROM TERITORRY ORDER BY RecId";

                oAdapter.SelectCommand = oCommand;
                oAdapter.Fill(ds);

                return ds.Tables[0];


            }
            catch
            {
                return null;
            }
        }
    }
}
